﻿<template>
	<div class="inner-content add-content">
		<div class="title">
			上传商品
		</div>
		<el-form :rules='rules' :model='form' ref='form'>

			<el-form-item label='水厂' prop='waterFactoryName'>
				<el-select placeholder="水厂名称" v-model="form.waterFactoryName" @change='getAllFactories'>
					<el-option v-for="item in form.waterFactoryName"  value="item">
					</el-option>
				</el-select>
			</el-form-item>

			<el-form-item label='品牌' prop='brand'>
				<el-input placeholder='请输入品牌名' v-model="form.brand">
				</el-input>
			</el-form-item>

			<el-form-item label='名字' prop='name'>
				<el-input placeholder='请输入商品名' v-model="form.name">
				</el-input>
			</el-form-item>

			<el-form-item label='规格（L）' prop='standard'>
				<el-input placeholder='请输入规格（L）' v-model="form.standard">
				</el-input>
			</el-form-item>

			<el-form-item label='空桶价格（元）' prop='blBuPr'>
				<el-input placeholder='请输入空桶价格' v-model="form.blBuPr">
				</el-input>
			</el-form-item>

			<el-form-item label='售价（元）' prop='prForWaUs'>
				<el-input placeholder='请输入售价' v-model="form.prForWaUs">
				</el-input>
			</el-form-item>

			<el-form-item label='水店价（元）' prop='prForWaSt'>
				<el-input placeholder='请输入水店价' v-model="form.prForWaSt">
				</el-input>
			</el-form-item>

			<el-form-item label='出厂价（元）' prop='producerPrice'>
				<el-input placeholder='请输入出厂价' v-model="form.producerPrice">
				</el-input>
			</el-form-item>

			<el-form-item label='配送提成（元）' prop='prForWaDe'>
				<el-input placeholder='请输入配送员获得提成' v-model="form.prForWaDe">
				</el-input>
			</el-form-item>

			<el-form-item label='一次性用水' prop='isDisposable'>
				<el-select placeholder="是否一次性桶" v-model="form.isDisposable">
					<el-option label="是" value="true"></el-option>
					<el-option label="否" value="false"></el-option>
				</el-select>
			</el-form-item>

			<el-form-item label='上传图片'>
				<el-upload
				  action=''
				  list-type="picture-card"
				  :on-preview="handlePictureCardPreview"
				  :on-remove="handleRemove">
				  <i class="el-icon-plus"></i>
				</el-upload>
				<el-dialog v-model="picDialogVisible" size="tiny">
				  <img width="100%" :src="picUrl" alt="预览图">
				</el-dialog>
			</el-form-item>	

			<el-form-item>
				<el-button @click='reset("form")'>重置</el-button>
				<el-button type="primary" @click='submitForm("form")'>确定</el-button>
			</el-form-item>		
		</el-form>
	</div>

</template>
<script>
    import AddJs from './Add.js';
    module.exports = AddJs;
</script>

<style scoped lang='less'>
    @import url(Add.less);
</style>